<p id="notice"><%= notice %></p>

<p>
  <strong>Title:</strong>
  <%= @product.title %>
</p>

<p>
  <strong>类别:</strong>
  <%= @product.category %>
</p>

<p>
  <strong>tags:</strong>
  <%= @product.tags %>
</p>

<p>
  <strong>封面:</strong>
  <%= image_tag @product.cover.url(:small) if @product.cover %>
</p>

<p>
  <strong>置顶:</strong>
  <%= @product.top %>
</p>

<p>
  <strong>置顶图:</strong>
  <%= image_tag @product.top_cover.url(:small) if @product.top_cover %>
</p>

<p>
  <strong>国家:</strong>
  <%= @product.country %>
</p>

<p>
  <strong>城市:</strong>
  <%= @product.city %>
</p>

<p>
  <strong>相关文章:</strong>
  <ul>
  <% @product.articles.each do |article| %>
    <li><%= link_to article.title, admin_article_path(article) %></li>
  <% end %>
  </ul>
</p>

<p>
  <strong>简介:</strong>
  <%= @product.description %>
</p>

<p>
  <strong>发布时间(utc):</strong>
  <%= @product.publish_time %>
</p>

<p>
  <strong>内容:</strong>
  <%= @product.content.html_safe %>
</p>

<p>
  <strong>pdf:</strong>
  <%= @product.read_attribute(:pdf) %>
</p>



<h1>图片列表</h1>

<% @uploads.each do |upload| %>
  <span id="upload-<%=upload.id%>">
  <%= image_tag upload.uploaded_file.url(:thumb) %>
  <%= link_to 'Destroy', [:admin, upload], method: :delete, data: { remote: true, confirm: 'Are you sure?' } %>
  </span>
<% end %>

<h1 id="upload_title">上传图片</h1>
<div class="alert alert-info">
  <ul>
    <li>请上传长宽比例相同的图片.</li>
  </ul>
</div>
<% @upload = Upload.new %>
<%= render :partial => "admin/uploads/form", locals: { 
          imageable_id: @product.id, imageable_type: @product.class.name } %>

<%= link_to 'Edit', edit_admin_product_path(@product) %> |
<%= link_to 'Back', admin_products_path %>
